package loon.srpg.ability;


import loon.srpg.actor.SRPGActor;
import loon.srpg.actor.SRPGActors;
import loon.srpg.actor.SRPGStatus;
import loon.srpg.effect.SRPGEffect;
import loon.srpg.field.SRPGField;


/**
 * Copyright 2008 - 2011
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 * 
 * @project loonframework
 * @author chenpeng
 * @email：ceponline@yahoo.com.cn
 * @version 0.1
 */
public abstract class SRPGAbility {
	/**
	 * 技能名字
	 */
	public String abilityName;
	/**
	 * 技能介绍
	 */
	public String abilityAbout;
	/**
	 * 行动最小范围(格数)，可限制不能近身施放，如数值为2，则周围第二格开始才有效，周围1格内都无效
	 */
	public int minLength;
	/**
	 * 行动最大范围（格数）,从角色周围第一格开始至该数值的所有格内为有效范围
	 */
	public int maxLength;
	/**
	 * 魔法影响度，0为物理攻击/消耗的mp
	 */
	public int mp;
	/**
	 * 附带作用数值，越大作用数值越不稳定/作用次数
	 */
	public int range;
	/**
	 * 作用范围（目标数），0为单体目标
	 */
	public int target;
	/**
	 *不详 
	 */
	public int counter;
	/**
	 * 不详
	 */
	public int direct;
	/**
	 * 是否反击，1为允许反击
	 */
	public int selectNeed;
	/**
	 * 基本作用数值
	 */
	public int baseDamage;
	/**
	 * 技能类型
	 */
	public int genre;

	public SRPGAbility() {
		initConfig();
	}

	public abstract void initConfig();
	/**
	 * 伤害数字画面实现
	 * @param damageaverage
	 * @param damageData
	 * @param status
	 * @return
	 */
	public abstract SRPGDamageData dataInput(SRPGDamageAverage damageaverage,SRPGDamageData damageData, SRPGStatus status);
	/**
	 * 施放该技能获得新技能
	 * @return
	 */
	public abstract int[] getAbilitySkill();
	/**
	 * 技能画面特效实现
	 * @param index
	 * @param actor
	 * @param j
	 * @param k
	 * @return
	 */
	public abstract SRPGEffect runAbilityEffect(int index, SRPGActor actor,
			int j, int k);
	/**
	 * 逻辑实现，包括伤害（此处作伤害，包含了治疗等数值）数值的运算，状态添加等
	 * @param attacker 施放方
	 * @param defender 承受方
	 * @param factory 获取施放方角色各种属性
	 * @param field 所处地形
	 * @param d 伤害设定
	 * @param actors 不详
	 */
	public abstract void runDamageExpect(SRPGActor attacker,SRPGActor defender,SRPGAbilityFactory factory, SRPGField field,
			SRPGDamageData d,
			SRPGActors actors);
}
